const moduleB = {
  state() {
    return {
      list: [],
    };
  },
  mutations: {
    getData(state, data) {
      state.list = data;
    },
  },
  actions: {
    asyncGetData({ commit }) {
      return new Promise((resolve, reject) => {
        fetch("http://118.24.239.63:3000/api/rated/list")
          .then((response) => response.json())
          .then((res) => {
            if (res.success) {
              commit("getData", res.data);
              resolve();
            }
          });
      });
    },
  },
};

export default moduleB;
